﻿/*********************************************************************************************************************
VanguardDocumentation, Table SessionVariables

© 2014 Erik Ackerholm

This file is part of SqlVanguard.

SqlVanguard is free software: you can redistribute it and/or modify it under the terms of the GNU General Public 
License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later 
version.

SqlVanguard is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied 
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with SqlVanguard. If not, see 
<http://www.gnu.org/licenses/>.
*********************************************************************************************************************/

if
	not exists (
		select *
		from sys.schemas as s
			inner join sys.objects as o on (s.schema_id = o.schema_id)
		where s.name = 'VanguardDocumentation' and o.[type] = 'U'
			and o.name = 'SessionVariables'
	)
begin
	
	create table VanguardDocumentation.SessionVariables (
		SessionID                integer not null,
		SessionStartTime         datetime not null,
		Variables                xml(document VanguardDocumentation.SessionVariables) not null
			constraint DF_SessionVariables_Variables default '<Variables/>',
		
		constraint PK_SessionVariables
			primary key clustered (SessionID, SessionStartTime)
	);
	
end;
GO




